**Housekeeping
clear all
cap log close
log using ${rep_root}/logs/inv_sup_status_tab_laquan.log, text replace
set more off

 
 
local cutoff = 50  
local seed = 9999  
local case_lb = `cutoff'

local covars vic_female_any vic_white_any acc_white acc_male acc_old cat_3 cat_4 d_mo_* d_dist_* arrests_pre complaints_pre force_pre any_prior_complaint tenure po

local heterolist_main  before after 
local heterolist  before early middle after  
local heterolist_yearly  t1 t2 t3 t4 t5 t6
 
*****************
**BRING IN CASE STATUS + COMPLAINTS DATA AND APPLY DATA RESTRICTION
***************** 

do ${rep_root}/code/data_restrict.do	
 
*****************
**MERGE WITH OUTCOMES DATA
*****************  
 
merge 1:1 cr_id acc_id using ${rep_root}/data/outcomes, keep(3) nogen 

**drop if accused are not police officers
//drop if acc_rank != "POLICE OFFICER"
 
 
*****************
**DEFINE TREATMENT AND MAKE COVARIATES
***************** 

**Drop investigators without enough cases
tab inv_id
sort inv_id 
by inv_id: gen inv_ct = _N
drop if inv_ct<`case_lb'
tab inv_id intake_yr

**Define some covariates
gen po = acc_rank == "POLICE OFFICER"
gen minor_inj = vic_inj_1<=1
gen vic_old = (year(inc_complaint_dt_1) - vic_byr_oldest)>=35 & !missing(vic_byr_oldest)
gen acc_old = acc_age>=35 & !missing(acc_age)
gen cat_3 = acc_cat==3
gen cat_4 = acc_cat==4
 
 

forvalues i = 1/25{
	gen d_dist_`i' = inc_district_1==`i'
}
forvalues yr = 2006/2008{
	gen d_yr_`yr' = intake_yr==`yr'

	forvalues m = 1/12{
		gen d_mo_yr_`m'_`yr' = intake_yr==`yr' & intake_mo==`m'
	}
	
}
forvalues yr = 2014/2018{
	gen d_yr_`yr' = intake_yr==`yr'
	
	forvalues m = 1/12{
		gen d_mo_yr_`m'_`yr' = intake_yr==`yr' & intake_mo==`m'
	}
}

 

**Define treatment
 

gen treat_affidavit = finding_cd != "NO AFFIDAVIT" 
gen treat_penalty = finding_cd == "SUSTAINED" | finding_cd == "NOT SUSTAINED"    
gen treat_sustain = finding_cd == "SUSTAINED"   

local treat_vars treat_affidavit  




*****************
**STORE FIRST STAGE
*****************  

foreach t in treat_affidavit  treat_sustain{

**Create LOM
capture drop resid cr_resid cr_ct inv_tot_resid case inv_ct2  
qui reg `t' `covars'
predict resid, residuals

sort cr_id
by cr_id: egen cr_resid = total(resid)
by cr_id: gen cr_ct = _N

sort inv_id intake_yr intake_mo
gen case = 1
by inv_id intake_yr: egen inv_tot_resid = total(resid)
by inv_id intake_yr: egen inv_ct2 = total(case)
gen lom_`t' = (inv_tot_resid - cr_resid)/(inv_ct2-cr_ct)

 


sort inv_id
by inv_id: sum lom_`t'
}
 
   

texdoc init ${rep_root}/output/tables/inv_sup_laquan_main.tex, replace force
tex \begin{tabular}{l*{4}{c}}
tex \hline\hline
tex                   &\multicolumn{1}{c}{Complaints}   &\multicolumn{1}{c}{Arrests}&\multicolumn{1}{c}{Type 1 Arrests} \\

texdoc close

/*
**Standardize LOMs

sum lom_treat_affidavit, d
replace lom_treat_affidavit = lom_treat_affidavit/ `r(sd)'

sum lom_treat_sustain, d
replace lom_treat_sustain = lom_treat_sustain/ `r(sd)'
*/


foreach hetero of local heterolist_main  {
 
	if "`hetero'" == "before" global rest intake_yearmo<ym(2015,11)
	if "`hetero'" == "early" global rest intake_yearmo<ym(2014,9)  
	if "`hetero'" == "middle" global rest intake_yearmo>=ym(2014,9) &intake_yearmo<ym(2015,11)
	if "`hetero'" == "after" global rest intake_yearmo>=ym(2015,11)
	if "`hetero'" == "force" global rest cat_4==1
	if "`hetero'" == "nonforce" global rest cat_4 == 0 
	if "`hetero'" == "low_tenure" global rest tenure<10
	if "`hetero'" == "high_tenure" global rest tenure>=10 
	
preserve
keep if $rest 


**************************
**OLS RESULTS
**************************



**First stage
foreach t in treat_affidavit{

sum `t'
local first_mean = r(mean)

reg `t' lom_`t' `covars', cluster(inv_id)
local first = _b[lom_`t']
local first_se = _se[lom_`t']
local first_N = e(N)
boottest lom_`t', weight(webb) nograph seed(`seed')
local first_f = r(t)^2
local first_p = r(p)

local first : di %6.3f `first'
local first_f : di %6.3f `first_f'

local first_mean_`t' : di %6.3f `first_mean'
local first_`t' : di %6.3f `first'
local first_se_`t' : di %6.3f `first_se'
local first_p_`t' : di %6.3f `first_p'
glo first_star_`t' = cond(`first_p_`t'' <0.01, "***", cond(`first_p_`t'' <0.05, "**", cond(`first_p_`t'' <0.1, "*", "")))
local first_f_`t' : di %6.3f `first_f'
local first_N_`t' : di %6.0f `first_N'
 
}


**get outcomes

  
 

local varlist complaints_postc1_3 arrests_postc1_3 type1_arrests_postc1_3 
 foreach t of local treat_vars{      
 

  
**Create Tables
foreach var of local varlist{
	reg `var' lom_`t' lom_treat_sustain `covars' , cluster(inv_id)
 
	local beta`var' = _b[lom_`t']
 	
	boottest lom_`t', weight(webb)  nograph seed(`seed')
local p`var' = r(p)
display r(p)


//get stars based on bootstrapped p values 
glo star_`var' = cond(`p`var'' <0.01, "***", cond(`p`var'' <0.05, "**", cond(`p`var'' <0.1, "*", "")))
local p`var' : di %6.3f `p`var'' 

matrix b`var' = e(b)
matrix v`var' = e(V)
scalar N= e(N)
local N`var' = N


local se`var' = sqrt(v`var'[1,1])

local beta`var' : di %6.3f `beta`var''
local se`var' : di %6.3f `se`var''
local N`var' : di %7.0fc `N`var''



sum `var'
local mean_`var' =r(mean)
local mean_`var' : di %6.2f `mean_`var''
}	 

if "`hetero'" == "before" local varname = "Before McDonald (- Oct 2015)"
if "`hetero'" == "early" local varname = "Sep 2006 - Jul 2008"
if "`hetero'" == "after" local varname = "After McDonald (Nov 2015 -)"
if "`hetero'" == "middle" local varname = "Sep 2014 - Oct 2015"
 
if "`hetero'" == "low_tenure" local varname = "Low tenure"
if "`hetero'" == "high_tenure" local varname = "High tenure"
if "`hetero'" == "any_prior" local varname = "Prior complaints"
if "`hetero'" == "force" local varname = "Force complaints"
if "`hetero'" == "nonforce" local varname = "Non-force complaints"
 

 
texdoc init ${rep_root}/output/tables/inv_sup_laquan_main.tex, append force  
tex \hline 
tex `varname' & `betacomplaints_postc1_3'${star_complaints_postc1_3} & `betaarrests_postc1_3'${star_arrests_postc1_3} & `betatype1_arrests_postc1_3'${star_type1_arrests_postc1_3} \\
tex       & (`secomplaints_postc1_3')     & (`searrests_postc1_3') & (`setype1_arrests_postc1_3')   \\
tex Bootstrap P & [`pcomplaints_postc1_3']& [`parrests_postc1_3']& [`ptype1_arrests_postc1_3']  \\
tex Dep. var. mean & `mean_complaints_postc1_3'& `mean_arrests_postc1_3'& `mean_type1_arrests_postc1_3'  \\
tex Observations & `Ncomplaints_postc1_3' & `Narrests_postc1_3'& `Ntype1_arrests_postc1_3'  \\
//tex First stage & `first'& `first'& `first'   \\
//tex First stage F-stat & `first_f'& `first_f'& `first_f'   \\

texdoc close
   

}

restore
}

texdoc init ${rep_root}/output/tables/inv_sup_laquan_main.tex, append force

tex \hline\hline
tex \end{tabular}

texdoc close
  
  
  
  
  
  

  
  
  
  

texdoc init ${rep_root}/output/tables/inv_sup_laquan.tex, replace force
tex \begin{tabular}{l*{4}{c}}
tex \hline\hline
tex                   &\multicolumn{1}{c}{Complaints}   &\multicolumn{1}{c}{Arrests}&\multicolumn{1}{c}{Type 1 Arrests} \\

texdoc close

 

foreach hetero of local heterolist  {
 
	if "`hetero'" == "before" global rest intake_yearmo<ym(2015,11)
	if "`hetero'" == "early" global rest intake_yearmo<ym(2014,9)  
	if "`hetero'" == "middle" global rest intake_yearmo>=ym(2014,9) &intake_yearmo<ym(2015,11)
	if "`hetero'" == "after" global rest intake_yearmo>=ym(2015,11)
	if "`hetero'" == "force" global rest cat_4==1
	if "`hetero'" == "nonforce" global rest cat_4 == 0 
	if "`hetero'" == "low_tenure" global rest tenure<10
	if "`hetero'" == "high_tenure" global rest tenure>=10 
	
preserve
keep if $rest 


**************************
**OLS RESULTS
**************************



**First stage
foreach t in treat_affidavit{

sum `t'
local first_mean = r(mean)

reg `t' lom_`t' `covars', cluster(inv_id)
local first = _b[lom_`t']
local first_se = _se[lom_`t']
local first_N = e(N)
boottest lom_`t', weight(webb) nograph seed(`seed')
local first_f = r(t)^2
local first_p = r(p)

local first : di %6.3f `first'
local first_f : di %6.3f `first_f'

local first_mean_`t' : di %6.3f `first_mean'
local first_`t' : di %6.3f `first'
local first_se_`t' : di %6.3f `first_se'
local first_p_`t' : di %6.3f `first_p'
glo first_star_`t' = cond(`first_p_`t'' <0.01, "***", cond(`first_p_`t'' <0.05, "**", cond(`first_p_`t'' <0.1, "*", "")))
local first_f_`t' : di %6.3f `first_f'
local first_N_`t' : di %6.0f `first_N'
 
}


**get outcomes

  
 

local varlist complaints_postc1_3 arrests_postc1_3 type1_arrests_postc1_3 
 foreach t of local treat_vars{      
 

  
**Create Tables
foreach var of local varlist{
	reg `var' lom_`t' lom_treat_sustain `covars' , cluster(inv_id)
 
	local beta`var' = _b[lom_`t']
 	
	boottest lom_`t', weight(webb)  nograph seed(`seed')
local p`var' = r(p)
display r(p)


//get stars based on bootstrapped p values 
glo star_`var' = cond(`p`var'' <0.01, "***", cond(`p`var'' <0.05, "**", cond(`p`var'' <0.1, "*", "")))
local p`var' : di %6.3f `p`var'' 

matrix b`var' = e(b)
matrix v`var' = e(V)
scalar N= e(N)
local N`var' = N


local se`var' = sqrt(v`var'[1,1])

local beta`var' : di %6.3f `beta`var''
local se`var' : di %6.3f `se`var''
local N`var' : di %7.0fc `N`var''



sum `var'
local mean_`var' =r(mean)
local mean_`var' : di %6.2f `mean_`var''
}	 

if "`hetero'" == "before" local varname = "Before McDonald (- Oct 2015)"
if "`hetero'" == "early" local varname = "Sep 2006 - Jul 2008"
if "`hetero'" == "after" local varname = "After McDonald (Nov 2015 -)"
if "`hetero'" == "middle" local varname = "Sep 2014 - Oct 2015"
 
if "`hetero'" == "low_tenure" local varname = "Low tenure"
if "`hetero'" == "high_tenure" local varname = "High tenure"
if "`hetero'" == "any_prior" local varname = "Prior complaints"
if "`hetero'" == "force" local varname = "Force complaints"
if "`hetero'" == "nonforce" local varname = "Non-force complaints"
 

 
texdoc init ${rep_root}/output/tables/inv_sup_laquan.tex, append force  
tex \hline 
tex `varname' & `betacomplaints_postc1_3'${star_complaints_postc1_3} & `betaarrests_postc1_3'${star_arrests_postc1_3} & `betatype1_arrests_postc1_3'${star_type1_arrests_postc1_3} \\
tex       & (`secomplaints_postc1_3')     & (`searrests_postc1_3') & (`setype1_arrests_postc1_3')   \\
tex Bootstrap P & [`pcomplaints_postc1_3']& [`parrests_postc1_3']& [`ptype1_arrests_postc1_3']  \\
tex Dep. var. mean & `mean_complaints_postc1_3'& `mean_arrests_postc1_3'& `mean_type1_arrests_postc1_3'  \\
tex Observations & `Ncomplaints_postc1_3' & `Narrests_postc1_3'& `Ntype1_arrests_postc1_3'  \\
//tex First stage & `first'& `first'& `first'   \\
//tex First stage F-stat & `first_f'& `first_f'& `first_f'   \\

texdoc close
   

}

restore
}

texdoc init ${rep_root}/output/tables/inv_sup_laquan.tex, append force

tex \hline\hline
tex \end{tabular}

texdoc close
    
  
  
  
  
  **********************
  *********************
  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  *********************  **********************
  ********************* 
  
gen nonindex_arrests_postc1_3 = arrests_postc1_3- type1_arrests_postc1_3   
  

texdoc init ${rep_root}/output/tables/inv_sup_laquan_yearly.tex, replace force
tex \begin{tabular}{l*{4}{c}}
tex \hline\hline
tex                   &\multicolumn{1}{c}{Complaints}   &\multicolumn{1}{c}{Arrests}&\multicolumn{1}{c}{Type 1 Arrests} \\

texdoc close

/*
**Standardize LOMs

sum lom_treat_affidavit, d
replace lom_treat_affidavit = lom_treat_affidavit/ `r(sd)'

sum lom_treat_sustain, d
replace lom_treat_sustain = lom_treat_sustain/ `r(sd)'
*/

gen max95_complaints_postc1_3 = .
gen min95_complaints_postc1_3  =.
gen betacomplaints_postc1_3 =.


gen max95_arrests_postc1_3 = .
gen min95_arrests_postc1_3  =.
gen betaarrests_postc1_3 =.

gen max95_type1_arrests_postc1_3  = .
gen min95_type1_arrests_postc1_3   =.
gen betatype1_arrests_postc1_3  =.


gen max95_nonindex_arrests_postc1_3  = .
gen min95_nonindex_arrests_postc1_3   =.
gen betanonindex_arrests_postc1_3  =.
 gen time =_n if _n<=4 

local counter = 1
foreach hetero of local heterolist_yearly  {
/*
 
	if "`hetero'" == "t1" global rest intake_yearmo<=ym(2007,8)
		if "`hetero'" == "t2" global rest intake_yearmo>=ym(2007,9) &intake_yearmo<ym(2008,7)
   
	if "`hetero'" == "t3" global rest intake_yearmo>=ym(2014,9) &intake_yearmo<ym(2015,11)
	if "`hetero'" == "t4" global rest intake_yearmo>=ym(2015,11)&intake_yearmo<ym(2016,11)
	if "`hetero'" == "t5" global rest intake_yearmo>=ym(2016,11)&intake_yearmo<ym(2017,11)
		if "`hetero'" == "t6" global rest intake_yearmo>=ym(2017,11)&intake_yearmo<ym(2018,12)
 
 
*/
 	if "`hetero'" == "t1" global rest intake_yearmo<=ym(2008,7)
 
   
	if "`hetero'" == "t2" global rest intake_yearmo>=ym(2014,9) &intake_yearmo<ym(2015,11)
	if "`hetero'" == "t3" global rest intake_yearmo>=ym(2015,11)&intake_yearmo<ym(2017,9)
	if "`hetero'" == "t4" global rest intake_yearmo>=ym(2017,9)&intake_yearmo<ym(2018,12)
 
 
 
	
preserve
keep if $rest 


**************************
**OLS RESULTS
**************************



**First stage
foreach t in treat_affidavit{

sum `t'
local first_mean = r(mean)

reg `t' lom_`t' `covars', cluster(inv_id)
local first = _b[lom_`t']
local first_se = _se[lom_`t']
local first_N = e(N)
boottest lom_`t', weight(webb) nograph seed(`seed')
local first_f = r(t)^2
local first_p = r(p)

local first : di %6.3f `first'
local first_f : di %6.3f `first_f'

local first_mean_`t' : di %6.3f `first_mean'
local first_`t' : di %6.3f `first'
local first_se_`t' : di %6.3f `first_se'
local first_p_`t' : di %6.3f `first_p'
glo first_star_`t' = cond(`first_p_`t'' <0.01, "***", cond(`first_p_`t'' <0.05, "**", cond(`first_p_`t'' <0.1, "*", "")))
local first_f_`t' : di %6.3f `first_f'
local first_N_`t' : di %6.0f `first_N'
 
}


**get outcomes

  
 

local varlist complaints_postc1_3 arrests_postc1_3 type1_arrests_postc1_3 nonindex_arrests_postc1_3



 
 foreach t of local treat_vars{      
 

  
**Create Tables
foreach var of local varlist{
	

	reg `var' lom_`t' lom_treat_sustain `covars' , cluster(inv_id)
 
	local beta`var' = _b[lom_`t']
 	
	boottest lom_`t', weight(webb)  nograph seed(`seed')
local p`var' = r(p)
 
   local dim  (`= rowsof(r(CI))')
 
	local b`var' = r(CI)[1,1]  
	local a`var' = r(CI)[`dim',2] 
 
	local c`var' =`beta`var''
 
	
//get stars based on bootstrapped p values 
glo star_`var' = cond(`p`var'' <0.01, "***", cond(`p`var'' <0.05, "**", cond(`p`var'' <0.1, "*", "")))
local p`var' : di %6.3f `p`var'' 

matrix b`var' = e(b)
matrix v`var' = e(V)
scalar N= e(N)
local N`var' = N


local se`var' = sqrt(v`var'[1,1])

local beta`var' : di %6.3f `beta`var''
local se`var' : di %6.3f `se`var''
local N`var' : di %7.0fc `N`var''



sum `var'
local mean_`var' =r(mean)
local mean_`var' : di %6.2f `mean_`var''
}	 

 
 

 
texdoc init ${rep_root}/output/tables/inv_sup_laquan_yearly.tex, append force  
tex \hline 
tex  & `betacomplaints_postc1_3'${star_complaints_postc1_3} & `betaarrests_postc1_3'${star_arrests_postc1_3} & `betatype1_arrests_postc1_3'${star_type1_arrests_postc1_3} \\
tex       & (`secomplaints_postc1_3')     & (`searrests_postc1_3') & (`setype1_arrests_postc1_3')   \\
tex Bootstrap P & [`pcomplaints_postc1_3']& [`parrests_postc1_3']& [`ptype1_arrests_postc1_3']  \\
tex Dep. var. mean & `mean_complaints_postc1_3'& `mean_arrests_postc1_3'& `mean_type1_arrests_postc1_3'  \\
tex Observations & `Ncomplaints_postc1_3' & `Narrests_postc1_3'& `Ntype1_arrests_postc1_3'  \\
//tex First stage & `first'& `first'& `first'   \\
//tex First stage F-stat & `first_f'& `first_f'& `first_f'   \\

texdoc close
   

}



restore



replace max95_complaints_postc1_3 = `acomplaints_postc1_3'  if time == `counter'
replace min95_complaints_postc1_3  =`bcomplaints_postc1_3'  if time == `counter'
replace betacomplaints_postc1_3 =`ccomplaints_postc1_3'  if time == `counter'


replace max95_arrests_postc1_3 = `aarrests_postc1_3'   if time == `counter'
replace min95_arrests_postc1_3  =`barrests_postc1_3'  if time == `counter'
replace betaarrests_postc1_3 =`carrests_postc1_3'  if time == `counter'

replace max95_type1_arrests_postc1_3  = `atype1_arrests_postc1_3'  if time == `counter'
replace min95_type1_arrests_postc1_3   =`btype1_arrests_postc1_3' if time == `counter'
replace betatype1_arrests_postc1_3  =`ctype1_arrests_postc1_3' if time == `counter'
 
replace max95_nonindex_arrests_postc1_3  = `anonindex_arrests_postc1_3'  if time == `counter'
replace min95_nonindex_arrests_postc1_3   =`bnonindex_arrests_postc1_3' if time == `counter'
replace betanonindex_arrests_postc1_3  =`cnonindex_arrests_postc1_3' if time == `counter'
  
 
local counter = `counter' +1
 
}

texdoc init ${rep_root}/output/tables/inv_sup_laquan_yearly.tex, append force

tex \hline\hline
tex \end{tabular}

texdoc close
 

preserve
drop if time == .
outsheet   max95_complaints_postc1_3 min95_complaints_postc1_3 betacomplaints_postc1_3 max95_arrests_postc1_3 min95_arrests_postc1_3 betaarrests_postc1_3 max95_type1_arrests_postc1_3 min95_type1_arrests_postc1_3 betatype1_arrests_postc1_3 time max95_nonindex_arrests_postc1_3 min95_nonindex_arrests_postc1_3 betanonindex_arrests_postc1_3 using ${rep_root}/data/effects_time.csv, comma replace
restore
 
 

 ******COMBINED


texdoc init ${rep_root}/output/tables/inv_sup_laquan_combined.tex, replace force
tex \begin{tabular}{l*{4}{c}}
tex \hline\hline
tex                   &\multicolumn{1}{c}{Complaints}   &\multicolumn{1}{c}{Arrests}&\multicolumn{1}{c}{Type 1 Arrests} \\

texdoc close

 





**First stage
foreach t in treat_affidavit{

sum `t'
local first_mean = r(mean)

reg `t' lom_`t' `covars', cluster(inv_id)
local first = _b[lom_`t']
local first_se = _se[lom_`t']
local first_N = e(N)
boottest lom_`t', weight(webb) nograph seed(`seed')
local first_f = r(t)^2
local first_p = r(p)

local first : di %6.3f `first'
local first_f : di %6.3f `first_f'

local first_mean_`t' : di %6.3f `first_mean'
local first_`t' : di %6.3f `first'
local first_se_`t' : di %6.3f `first_se'
local first_p_`t' : di %6.3f `first_p'
glo first_star_`t' = cond(`first_p_`t'' <0.01, "***", cond(`first_p_`t'' <0.05, "**", cond(`first_p_`t'' <0.1, "*", "")))
local first_f_`t' : di %6.3f `first_f'
local first_N_`t' : di %6.0f `first_N'
 
}


**get outcomes

  
 gen post = intake_yearmo>=ym(2015,11)

local varlist complaints_postc1_3 arrests_postc1_3 type1_arrests_postc1_3 
   
 

 
**Create Tables


**Create Tables
foreach var of local varlist{
	
 
 reg `var' c.lom_treat_affidavit##1.post `covars' lom_treat_sustain , cluster(inv_id)
	local beta`var' = _b[lom_treat_affidavit]
 	
	boottest lom_treat_affidavit, weight(webb)  nograph seed(`seed')
local p`var' = r(p)
display r(p)


//get stars based on bootstrapped p values 
glo star_`var' = cond(`p`var'' <0.01, "***", cond(`p`var'' <0.05, "**", cond(`p`var'' <0.1, "*", "")))
local p`var' : di %6.3f `p`var'' 

matrix b`var' = e(b)
matrix v`var' = e(V)
scalar N= e(N)
local N`var' = N


local se`var' = sqrt(v`var'[1,1])

local beta`var' : di %6.3f `beta`var''
local se`var' : di %6.3f `se`var''

	local betaint`var' = _b[1.post#c.lom_treat_affidavit]
	boottest 1.post#c.lom_treat_affidavit, weight(webb)  nograph seed(`seed')
local pint`var' = r(p)
display r(p)


//get stars based on bootstrapped p values 
glo starint_`var' = cond(`pint`var'' <0.01, "***", cond(`pint`var'' <0.05, "**", cond(`pint`var'' <0.1, "*", "")))
local pint`var' : di %6.3f `pint`var'' 

local seint`var' = sqrt(v`var'[3,3])

local betaint`var' : di %6.3f `betaint`var''
local seint`var' : di %6.3f `se`var''




local N`var' : di %7.0fc `N`var''



sum `var'
local mean_`var' =r(mean)
local mean_`var' : di %6.2f `mean_`var''
}	 

 
 
texdoc init ${rep_root}/output/tables/inv_sup_laquan_combined.tex, append force  
tex \hline 
tex Before Laquan & `betacomplaints_postc1_3'${star_complaints_postc1_3} & `betaarrests_postc1_3'${star_arrests_postc1_3} & `betatype1_arrests_postc1_3'${star_type1_arrests_postc1_3} \\
tex       & (`secomplaints_postc1_3')     & (`searrests_postc1_3') & (`setype1_arrests_postc1_3')   \\
tex \quad Bootstrap P & [`pcomplaints_postc1_3']& [`parrests_postc1_3']& [`ptype1_arrests_postc1_3']  \\

tex Post-Laquan Interaction & `betaintcomplaints_postc1_3'${starint_complaints_postc1_3} & `betaintarrests_postc1_3'${starint_arrests_postc1_3} & `betainttype1_arrests_postc1_3'${starint_type1_arrests_postc1_3} \\
tex       & (`seintcomplaints_postc1_3')     & (`seintarrests_postc1_3') & (`seinttype1_arrests_postc1_3')   \\
tex \quad Bootstrap P & [`pintcomplaints_postc1_3']& [`pintarrests_postc1_3']& [`pinttype1_arrests_postc1_3']  \\
tex Dep. var. mean & `mean_complaints_postc1_3'& `mean_arrests_postc1_3'& `mean_type1_arrests_postc1_3'  \\
tex Observations & `Ncomplaints_postc1_3' & `Narrests_postc1_3'& `Ntype1_arrests_postc1_3'  \\
//tex First stage & `first'& `first'& `first'   \\
//tex First stage F-stat & `first_f'& `first_f'& `first_f'   \\
 
tex \hline\hline
tex \end{tabular}

texdoc close	
log close
	
